/*
 * Copyright (C) 2000-2006 Sailing Group
 * 
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 * 
 */
package lfp.monitor;

import lfp.gui.forecast.model.IForecastModelDBHelper;

import java.util.Calendar;
import java.util.HashSet;
import java.util.Set;

import hhh.utils.CalendarUtil;

/**
 * <pre>
 * Developer: hhh
 * Date: 2007-1-11
 * </pre>
 */
public class MockForecastModelDBHelper implements IForecastModelDBHelper {
    public boolean writeForecastLoad(double[] doubles, Calendar calendar, Calendar calendar1, int i) {
        return false;
    }

    public double[] readForecastLoad(Calendar begin, Calendar end, int gap_minute) {
        Calendar nowCal = Calendar.getInstance();
        Calendar beginCal = (Calendar) nowCal.clone();
        beginCal.set(Calendar.HOUR_OF_DAY,0);
        beginCal.set(Calendar.MINUTE,0);
        beginCal.set(Calendar.SECOND,0);
        beginCal.set(Calendar.MILLISECOND,0);
        int minuteSpan = (int) CalendarUtil.getTimeSpan(Calendar.MINUTE,beginCal, nowCal);
        double[] load = new double[1440/gap_minute];
        for (int i = 0; i < minuteSpan/gap_minute; i++) {
            load[i] = 500 + i;
        }
        return load;
    }

    public double[] readDayPlanLoad(Calendar calendar, Calendar calendar1, int i) {
        return new double[0];  //To change body of implemented methods use File | Settings | File Templates.
    }

    public double[] readHistoryLoad(Calendar begin, Calendar end, int gap_minute) {
        Calendar nowCal = Calendar.getInstance();
        Calendar beginCal = (Calendar) nowCal.clone();
        beginCal.set(Calendar.HOUR_OF_DAY,0);
        beginCal.set(Calendar.MINUTE,0);
        beginCal.set(Calendar.SECOND,0);
        beginCal.set(Calendar.MILLISECOND,0);
        int minuteSpan = (int) CalendarUtil.getTimeSpan(Calendar.MINUTE,beginCal, nowCal);
        double[] load = new double[1440/gap_minute];
        for (int i = 0; i < minuteSpan/gap_minute - 6; i++) {
            load[i] = 400 + i;
        }
        return load;
    }

    public double[] readAppiedLoad(Calendar calendar, Calendar calendar1, int i) {
        return new double[0];  //To change body of implemented methods use File | Settings | File Templates.
    }

    public Set<String> getForecastMethodNames() {
        return new HashSet<String>();
    }
}

